<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<link rel="stylesheet" type="text/css" href="/static/kindeditor/themes/default/default.css"/>
		<script charset="utf-8" src="/static/kindeditor/kindeditor-all.js"></script>
		<script charset="utf-8" src="/static/kindeditor/lang/zh-CN.js"></script>
		<script src="/static/js/jquery.min.js" type="text/javascript" charset="utf-8"></script>
	</head>
	<body>
		标题<input type="text" name="text"  id="text" value="" />
		<br />
		文章内容<textarea id="editor_id" name="content" style="width:700px;height:300px;">
			&lt;strong&gt;HTML内容&lt;/strong&gt;
		</textarea>
		<br />
		<input type="button" name="btn" id="btn" value="提交" />
		<script type="text/javascript">
			var editor = KindEditor.create('#editor_id',{
                	width:'1000px',//设置编辑器的宽
                	//items:['undo', 'redo']	只出现两个undo	后退redo	前进按钮
                	//设置工具栏的按钮
                	uploadJson : '/ajax.php?ajax=upload',	//文件上传程序
					fileManagerJson : '/ajax.php?ajax=file_manager',	//浏览服务器图片空间
					allowFileManager : true,//启用图片空间按钮
                });
                //console.log(editor.html());
                $('#btn').click(function(){
	                $.ajax({
	                		type:"post",
	                		url:"/ajax.php?ajax=article",
	                		data:{
	                			html:editor.html(),
	                			title:$('input[name=text]').val(),
	                			
	                		},
	                		success:function(mgs){
	                			console.log(mgs);
	                		}
	                });
	            });
		</script>
	</body>
</html>
